package com.zx.springcloud.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author ZX
 * @date 2021/4/7
 */
 public  interface PaymentService
{


    /**
     * 正常访问
     * @param id
     * @return
     */
     String paymentInfo_OK(Integer id);

    @HystrixCommand(fallbackMethod = "paymentInfo_TimeOutHandler",commandProperties = {
        @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
     String paymentInfo_Timeout(Integer id);

     String paymentInfo_TimeOutHandler(Integer id);

    public String paymentCircuitBreaker(@PathVariable("id") Integer id);
}
